//第二层axios封装  商品管理模块模块,所有用户管理模块的接口 
import request from '@/utils/request.js' //引入增强过后的axios

//添加商品分类
export const addCate = (data) => {
    return request({
        method: 'post',
        url: '/goods/addcate',
        data,
    });
}

//查询所有启用的分类名称
export const categories = (params) => {
    return request({
        method: 'get',
        url: '/goods/categories',
        params,
    })
}

//获取商品分类列表
export const cateList = (params) => {
    return request({
        method: 'get',
        url: '/goods/catelist',
        params,
    })
}
//删除分类
export const delCate = (params) => {
    return request({
        method: 'get',
        url: '/goods/delcate',
        params,
    })
}

//修改分类
export const editCate = (data) => {
    return request({
        method: 'post',
        url: '/goods/editcate',
        data,
    });
}

//获取商品列表
export const goodsList = (params) => {
    return request({
        method: 'get',
        url: '/goods/list',
        params,
    })
}

//添加商品
export const goodsAdd = (data) => {
    return request({
        method: 'post',
        url: '/goods/add',
        data,
    });
}

//删除商品
export const goodsDel = (params) => {
    return request({
        method: 'get',
        url: '/goods/del',
        params,
    })
}

//修改商品
export const goodsEdit = (data) => {
    return request({
        method: 'post',
        url: '/goods/edit',
        data,
    })
}